package com.kefu.robot.vo;

import javax.validation.constraints.NotEmpty;

import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.robot.model.RobotAidataInfo;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xiaoyu
 * @date 2023/11/03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "AI模型信息")
public class RobotAidataInfoUpdateVo extends AbstractUpdateVo<RobotAidataInfo, String> {

    @NotEmpty
    @ApiModelProperty(value = "主键", required = true)
    private String aidataId;
    @ApiModelProperty(value = "名称")
    private String aidataName;
    @ApiModelProperty(value = "状态 0：未启用 1：启用")
    private Integer state;
    @ApiModelProperty(value = "备注")
    private String remark;

    @Override
    public RobotAidataInfo convert() {
        RobotAidataInfo info = BeanUtil.toBean(this, RobotAidataInfo.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setUpdateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        return info;
    }
}